package com.xc.freeapp.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.miemiedev.mybatis.paginator.domain.PageBounds;
import com.xc.freeapp.dao.ArticleMapper;
import com.xc.freeapp.dao.dataSource.DBContextHolder;
import com.xc.freeapp.entity.Article;

@Service
public class ArticleService {
	Logger log = Logger.getLogger(this.getClass());
	@Autowired
	ArticleMapper ArticleMapper;
	
	public List<Article> selectByHospitalid(String hospitalid,PageBounds pageBounds){
		DBContextHolder.switchDataSourceRW();//切换数据源
		return ArticleMapper.selectByHospitalid(hospitalid,pageBounds);
	}
	
	public  Article selectByPrimaryKey(Integer id){
		DBContextHolder.switchDataSourceRW();//切换数据源
		return ArticleMapper.selectByPrimaryKey(id);
	}
}
